From 898bc98d3bae8baf60c3d666d8b540c55a54b645 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 4 Dec 2011 18:40:19 -0500 Subject: [PATCH] Update GtkApplicationWindow docs --- docs/reference/gtk/gtk3-sections.txt | 5 ++-- gtk/gtkapplicationwindow.c | 38 +++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index 6d83478685..acf9c92e5c 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -7024,9 +7024,8 @@ GtkApplicationPrivate GtkApplicationWindow GtkApplicationWindow gtk_application_window_new -gtk_application_window_set_show_app_menu -gtk_application_window_get_show_app_menu -gtk_application_window_get_app_menu +gtk_application_window_set_show_menubar +gtk_application_window_get_show_menubar GtkApplicationWindowClass diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index 3577842c0d..24adfce16c 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -49,7 +49,7 @@ * If the desktop environment does not display the application menu * as part of the desktop shell, then #GApplicationWindow will * automatically show the menu as part of a menubar. This behaviour - * can be overridden with the #GtkApplicationWindow:show-app-menu + * can be overridden with the #GtkApplicationWindow:show-menubar * property. */ struct _GtkApplicationWindowPrivate @@ -568,11 +568,22 @@ gtk_application_window_class_init (GtkApplicationWindowClass *class) object_class->set_property = gtk_application_window_set_property; object_class->dispose = gtk_application_window_dispose; + /** + * GtkApplicationWindow:show-menubar: + * + * If this property is %TRUE, the window will display a menubar + * that includes the app menu and menubar, unless these are + * shown by the desktop shell. See g_application_set_app_menu() + * and g_application_set_menubar(). + * + * If %FALSE, the window will not display a menubar, regardless + * of whether the desktop shell is showing the menus or not. + */ gtk_application_window_properties[PROP_SHOW_MENUBAR] = g_param_spec_boolean ("show-menubar", P_("Show a menubar"), - P_("TRUE if the application's menus should be included " - "in the menubar at the top of the window"), + P_("TRUE if the window should show a " + "menubar at the top of the window"), TRUE, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE); g_object_class_install_properties (object_class, N_PROPS, gtk_application_window_properties); g_type_class_add_private (class, sizeof (GtkApplicationWindowPrivate)); @@ -598,12 +609,33 @@ gtk_application_window_new (GtkApplication *application) NULL); } +/** + * gtk_application_window_get_show_menubar: + * @window: a #GtkApplicationWindow + * + * Returns whether the window will display a menubar for the app menu + * and menubar as needed. + * + * Returns: %TRUE if @window will display a menubar when needed + * + * Since: 3.4 + */ gboolean gtk_application_window_get_show_menubar (GtkApplicationWindow *window) { return window->priv->show_menubar; } +/** + * gtk_application_window_set_show_menubar: + * @window: a #GtkApplicationWindow + * @show_menubar: whether to show a menubar when needed + * + * Sets whether the window will display a menubar for the app menu + * and menubar as needed. + * + * Since: 3.4 + */ void gtk_application_window_set_show_menubar (GtkApplicationWindow *window, gboolean show_menubar) -- 2.30.2